<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-form ref="form" :model="file_admin" :rules="rules" label-width="100px" id="mvcfm">
          <el-button @click="filesAddSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>顶提交</el-button>
          <div class="form-unit">
            <span class="mvc-title-left"> 添加文件 </span>
          </div>
          <div>
            <el-row>
              <el-col :span="12">
                <el-form-item label="文件编号" prop="file_name">
                  <el-input v-model="file_admin.file_name" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="文件名称" prop="file_name">
                  <el-input v-model="file_admin.file_name" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="文件格式" prop="file_typeid">
                  <el-select style='width:100%' v-model="file_admin.file_typeid">
                    <el-option label="TXT" value="TXT" />
                    <el-option label="PDF" value="PDF" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="文件技术评审" prop="file_techcheck">
                  <el-select style='width:100%' v-model="file_admin.file_techcheck">
                    <el-option label="有效" value="有效" />
                    <el-option label="无效" value="无效" />
                  </el-select>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="文件描述" prop="file_des">
                  <el-input v-model="file_admin.file_des" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <input type=file />
              </el-col>
            </el-row>
          </div>
        </el-form>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'关联信息'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'FilesAdd',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        file_admin: {
          file_name: null,
          file_name: null,
          file_typeid: null,
          file_techcheck: null,
          file_des: null,
        },
        loading: false,
        Container: null,
        rules: {}
      }
    },
    created() {
      this.loadContainerMenu({
        pid: "96A3E61372E7413BBC09A5C5A5A9D811",
        name: "右菜单列表",
        selected: "关联信息"
      }, 'Container', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      filesAddSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/psi/supplychainmana/SupplierCtrl/filesAddSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.$router.replace("/redirect" + this.$route.fullPath);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
